<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s"  uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<% String projectPath = request.getContextPath(); %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=cn-gb">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		  <s:head theme="xhtml"/>
  		  <sx:head parseContent="true"/>

		<title>添加 入库结账单</title>

		<script type="text/javascript" src="<%=projectPath %>/js/processSettle.js" ></script>

		<style type="text/css">
		.errorMessage {
			font-size: 12px;
			color: red;
		}
		</style>
	</head>

	<body>
		<center>
			<h2>
				添加 入库结账单
			</h2>
		</center>
		<center>

			<%  String sErrMsg = request.getParameter( "error" ) ;
				if ( sErrMsg == null ) sErrMsg = "";
				sErrMsg = new String( sErrMsg.getBytes("ISO-8859-1"), "UTF-8" );
			%>
			<font color="red"><%= sErrMsg %></font>

			<table border="1">
				<tr>
					<td>入库单总额：</td>    <td><s:property value="%{settleRemain.needSettle}" /></td>
					<td>入库单已结金额：</td><td><s:property value="%{settleRemain.hasSettle}" /></td>
				</tr>
			</table>
			<br/>

			<s:form method="post">

				<s:hidden name="buyInSettle.buyInId"     value="%{buyInMainId}"/>
				<s:hidden name="oldSettleMoney"          value="0" id="oldSettleMoney"/> <!-- 为跟 Mod.jsp 一致 -->
				<s:hidden name="settleRemain.needSettle" value="%{settleRemain.needSettle}" id="needSettle" />
				<s:hidden name="settleRemain.hasSettle"  value="%{settleRemain.hasSettle}"  id="hasSettle" />

				<table>
					<tr>
						<td>
							<sx:datetimepicker label="结账日期" name="buyInSettle.settleDate" value="%{date}"
							   displayFormat="yy-MM-dd" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="本次结款" name="buyInSettle.settleMoney"  id="settleMoney" />
						</td>
					</tr>
					<tr>
						<td>
							<s:select id="settlerId" name="buyInSettle.settlerId" label="结账人"
								  list="%{#request.allUser}"
								  listKey="id" listValue="name" />
						</td>
					</tr>
					<tr>
						<td>
							<s:textfield label="经手人" name="buyInSettle.handler"  id="handler" />
						</td>
					</tr>

					<tr align="center">
						<td colspan="2">
							<input type="button" value="保存" name="Save" onclick="processSettleAction( 'addNewBuyInSettle' );" />
							<input type="reset"  value="重置" name="Reset" />
							<input type="button" value="返回" name="Back" onclick="history.go(-1);" />
						</td>
					</tr>
				</table>
			</s:form>
		</center>
	</body>
</html>